<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Noc extends CI_Controller {

        public function __construct(){

            parent::__construct();
            $this->load->helper('url');
        }

	public function index()
	{
		$this->load->view('front_end/main_view');
	}

        public function login()
	{
            $this->load->model('User_model');

            $username   = $this->input->post('admin_user');
            $pass       = $this->input->post('admin_pass');
            $password   =   MD5($pass);

            if($username!="" || $pass!="")
            {
                if( $this->User_model->login($username, $password))
                        //put session data
                    redirect(site_url("admin/backend"));
                else echo "login falied";
            }
        }
}
